local ResourceManager = class("ResourceManager")
local resManager = CS.ResourceManager.Instance

function ResourceManager:ctor()
end

function ResourceManager:loadPrefabs(path)
    return resManager:LoadPrefabs(path)
end

function ResourceManager:loadPrefabsAnsc(path, finish)
    return resManager:LoadPrefabsAnsc(path, finish)
end

function ResourceManager:loadActor(name)
    return self:loadPrefabs("Prefabs/Actor/" .. name)
end

function ResourceManager:loadEffect(name)
    return self:loadPrefabs("Prefabs/Effects/" .. name)
end

function ResourceManager:loadIcon(name)
    return self:loadPrefabs("Prefabs/Icon/" .. name)
end

function ResourceManager:loadUI(name)
    return self:loadPrefabs("Prefabs/UI/" .. name)
end

function ResourceManager:loadView(name)
    return self:loadPrefabs("Prefabs/View/" .. name)
end

function ResourceManager:loadMaterial(name)
    return self:loadPrefabs("Prefabs/Materials/" .. name)
end

function ResourceManager:loadBuff(name)
    return self:loadPrefabs("Prefabs/Buff/" .. name)
end

function ResourceManager:loadSprite(altas, name)
    local altasPath = "Prefabs/AtlasMat/" .. altas
    local altasObject = resManager:LoadSptiteAtlas(altasPath)
    local sprite = altasObject:GetSprite(name)
    return sprite
end

function ResourceManager:loadProto()
    return resManager:loadBytesBuffer("LuaScripts/proto/mmorpg.pb")
end

function ResourceManager:checkUpdate(onUpdateFinish, onUpdateProgress)
    resManager:CheckUpdate(onUpdateFinish, onUpdateProgress)
end

return ResourceManager
